Include "Windows/TilesetWindow.bmx"
Include "Windows/MapWindow.bmx"

Include "Windows/NewProjectWindow.bmx"


Const TOOL_TYPE_DEF : Int = 0
Const TOOL_TYPE_TILE : Int = 1
Const TOOL_TYPE_MAP : Int = 2


Type ToolWindow


	Field Window : TGadget
	Field Pos : UIRect = New UIRect
	Field Title : String
	Field Gadgets : TGadget[]
	Field ToolType : Int
	Field ParentList : TList
	Field AssetNode : TGadget
	Field EditMode : Byte = False
	
	Method Update(EID:Int,Obj:Object,EEX:Object = Null)
	
		If EID = EVENT_WINDOWCLOSE Then
			If Obj = Window Then
				DebugLog "Gadget len: "+Gadgets.length
				For Local Gad : TGadget = EachIn Gadgets
				
					
					Gad = Null
				
				Next
				FreeGadget Window
				ListRemove(ParentList,Self)
			EndIf
		EndIf		
	
	End Method
	
	Method SetAll(ttitle:String,x:Int,y:Int,w:Int,h:Int,plist:TList)
	
		Pos.x = x
		Pos.y = y
		Pos.w = w
		Pos.h = h
		Title = ttitle
		ParentList = plist
	
	End Method
	
	Method Set()
	

		Local Gads : TGadget[10]	
		
		
		Gadgets = Gads
	End Method




End Type
